from TextBadger.models import *
from xml.dom.minidom import parse
from django.conf import settings
import sys

def Classify(job):
        return True

jobs = Job.objects.filter(status=2)

for job in jobs:
	job.status=3
	job.save()

for job in jobs:
	print job.id
	
	try:
		# check code file for security issues
		r = Classify(job)
		if r == True:
			job.status = 1
			job.save()
		else:
                        job.status = 4
                        job.save()
	except:
		print sys.exc_type, ":", sys.exc_value
		print 'Classification Error.'
		job.status = 4
		job.save()

